package top.hmtools.controllers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;

import javafx.fxml.Initializable;
import top.hmtools.GMContext;
import top.hmtools.services.DbManageService;
import top.hmtools.services.GenerateService;
import top.hmtools.services.MapperXmlTempletFileManageService;
import top.hmtools.services.SqlPartManageService;

/**
 * controoler层基础类
 * @author HyboJ
 *
 */
public abstract class BaseController implements Initializable{
	
	protected final Logger logger = LoggerFactory.getLogger(this.getClass());
	
	/**
	 * spring容器上下文
	 */
	protected ApplicationContext applicationContext = GMContext.applicationContext;

	/**
	 * 数据库信息管理业务逻辑
	 */
	protected DbManageService dbManageService = applicationContext.getBean(DbManageService.class);
	
	/**
	 * mapper xml文件中SQL语句片段业务逻辑
	 */
	protected SqlPartManageService sqlPartManageService = applicationContext.getBean(SqlPartManageService.class);
	
	/**
	 * mapper xml 模板文件逻辑业务
	 */
	protected MapperXmlTempletFileManageService mapperXmlTempletFileManageService = applicationContext.getBean(MapperXmlTempletFileManageService.class);
	
	/**
	 * 获取根据数据库表数据，生成对应mybatis可用的pojo，dao，mapper.xml的业务逻辑对象
	 */
	protected GenerateService generateService = applicationContext.getBean(GenerateService.class);

}
